import http from '..//utils/http'


// 商品详情添加到购物车  购物车更新商品数量
export const reqAddCart = ({goodsId, count, ...data}) => {
  return http.get(`/cart/addToCart/${goodsId}/${count}`, data)
}

// 获取购物车列表
export const reqCartList = () => {
  return http.get('/cart/getCartList')
}

// 更新商品购买状态 选中/未选中
export const reqUpdateChecked = (goodsId, isChecked) => {
  return http.get(`/cart/checkCart/${goodsId}/${isChecked}`)
}

// 全选与全不选
export const reqCheckAllStatus = (isChecked) => {
  return http.get(`/cart/checkAllCart/${isChecked}`)
}


// 删除购物车商品
export const reqDeleteCart = (goodsId) => {
  return http.get(`/cart/delete/${goodsId}`)
}




